// const sleepDecoratorFactory = (time: number):MethodDecorator => {
//     return (target:Object, propertyKey:string | symbol,descriptor:PropertyDescriptor) => {
//         const method = descriptor.value;
//         descriptor.value = () => {
//             setTimeout(() => {
//                 method();
//             },time)
//         }
//     }
// }

const sleepDecoratorFactory = (time: number):MethodDecorator => 
(...args:any[]) => {
    const [,,descriptor] = args;
    const method = descriptor.value;
    descriptor.value = () => {
        setTimeout(() => {
            method();
        },time)
    }
}

class User{
    @sleepDecoratorFactory(1000)
    public response(){
        console.log("后盾人")
    }
}

new User().response();